<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>倒计时</title>
	
		<script>
			var i = 10;
			function daojishi() {
				document.getElementById("showtime").innerHTML = i;
				i--;
				if(i == 0) {
					window.location.href = "http://www.baidu.com";
					window.clearInterval(now);
				}
			}

			function start() {
				setInterval("daojishi()", 1000);
			}
		</script>
	</head>

	<body>
		<div id="showtime" style="color: red;">
			<input type="button" value="确认支付" onclick="start()" />
		</div>
	</body>

</html>